package com.irdstudio.apicenter.console.controller.authenticate;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.irdstudio.apicenter.console.controller.MacmsBaseAction;
import com.irdstudio.apicenter.console.dm.AppRole;
import com.irdstudio.apicenter.console.service.authenticate.AppRoleService;

/**
 * app应用管理
 * 
 * @author jr
 * 
 */
@Controller
@RequestMapping(value = "/appRoleRight")
public class AppRoleRightAction extends MacmsBaseAction {
	@Autowired
	private AppRoleService appRoleService;

	@RequestMapping(value = "jumpAddRoleRightPage")
	public String jumpAddRole(HttpServletRequest request) throws SQLException,
			ClassNotFoundException {
		String appId = request.getParameter("appid");
		List<AppRole> arList = new ArrayList<AppRole>();
		arList = appRoleService.queryByAppID(appId);
		request.setAttribute("arList", arList);
		request.setAttribute("appid", appId);
		return "auth/setAppRoleRight";
	}

}
